﻿using System;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.nodes.mssql;

namespace SharpSqlAnalyzer.stmt.mssql
{
	// Token: 0x0200016B RID: 363
	public class TMssqlCreateType : TCustomSqlStatement
	{
		// Token: 0x17000251 RID: 593
		// (get) Token: 0x06000C90 RID: 3216 RVA: 0x003079D8 File Offset: 0x00305BD8
		// (set) Token: 0x06000C8F RID: 3215 RVA: 0x003079CF File Offset: 0x00305BCF
		public virtual TObjectName Type_name
		{
			get
			{
				return this.type_name;
			}
			set
			{
				this.type_name = value;
			}
		}

		// Token: 0x17000252 RID: 594
		// (get) Token: 0x06000C92 RID: 3218 RVA: 0x003079E9 File Offset: 0x00305BE9
		// (set) Token: 0x06000C91 RID: 3217 RVA: 0x003079E0 File Offset: 0x00305BE0
		public virtual TTypeName Base_type
		{
			get
			{
				return this.base_type;
			}
			set
			{
				this.base_type = value;
			}
		}

		// Token: 0x17000253 RID: 595
		// (get) Token: 0x06000C94 RID: 3220 RVA: 0x003079FA File Offset: 0x00305BFA
		// (set) Token: 0x06000C93 RID: 3219 RVA: 0x003079F1 File Offset: 0x00305BF1
		public virtual TObjectName ExternalName
		{
			get
			{
				return this.externalName;
			}
			set
			{
				this.externalName = value;
			}
		}

		// Token: 0x06000C95 RID: 3221 RVA: 0x00307A02 File Offset: 0x00305C02
		public TMssqlCreateType(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstmssqlcreatetype;
		}

		// Token: 0x06000C96 RID: 3222 RVA: 0x00307A18 File Offset: 0x00305C18
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TMssqlCreateTypeSqlNode tmssqlCreateTypeSqlNode = (TMssqlCreateTypeSqlNode)this.rootNode;
			this.type_name = tmssqlCreateTypeSqlNode.Type_name;
			this.type_name.ObjectType = 27;
			base.DatabaseObjects.Add(this.type_name);
			this.base_type = tmssqlCreateTypeSqlNode.Base_type;
			this.externalName = tmssqlCreateTypeSqlNode.ExternalName;
			return 0;
		}

		// Token: 0x06000C97 RID: 3223 RVA: 0x00307A7E File Offset: 0x00305C7E
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000C98 RID: 3224 RVA: 0x00307A8E File Offset: 0x00305C8E
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x040012E9 RID: 4841
		private TObjectName type_name;

		// Token: 0x040012EA RID: 4842
		private TTypeName base_type;

		// Token: 0x040012EB RID: 4843
		private TObjectName externalName;
	}
}
